﻿@model XichLoGreen.Models.NewsModel
<link href="@Url.Content("~/Content/GreenNews.css")" rel="stylesheet" type="text/css" />
@{
    ViewBag.Title = "Preview";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@*<script src="http://code.jquery.com/jquery-1.9.1.js"></script>*@

@{
   string model =  new System.Web.Script.Serialization.JavaScriptSerializer().Serialize(Model.Content);
}
<script type="text/javascript">
    $(document).ready(function () {
        
        
        var str = @Html.Raw(model);
       var html = $.parseHTML(str);

        $("#pre_content").append(html);
        //document.getElementById('pre_content').innerHTML += tag;
    });
</script>
@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
<fieldset>
    <legend style="font-size:x-large">@Model.Title</legend>
        <input type="text" style="visibility:hidden" value="@Model.ID" name="id" />
    <br />
        <label class="pre_sum">@Model.Summary</label>
        <br />
        <table style="width: auto; margin-left:260px;" border="0"   >
            <tr>
                <td style="text-align:center"><img src="@Model.Picture" class ="picture" style="margin:auto"/></td>
                
                </tr>
            <tr><td style="max-width:400px; text-align:center"><label class="pre_imgConmment">@Model.ImageComment</label></td></tr>
            </table>   
        <br />
        <br />
        <div id="pre_content"></div>
        
        <br />
        <label class="pre_author" style="margin-right:10px;">@Model.Author</label>
</fieldset>
<p>
    <input type="submit" value="Save" name ="button"/>
    <input type="submit" value="Cancel" name="button" />
</p>
}